bipartite environment

A bipartite graph is drawn by bipartite environment. The bipartite environment has five arguments. They represent the following parameters.

  1. Maximum width of labels in the left node group.
  2. Width of gap between the left node group and the right node group.
  3. Maximum width of labels in the right node group.
  4. Minimum height of vertical gaps between node labels.
  5. Width between a node (bullet) and its label.
Labels in the left node group should be specified by \leftnode in this environment. Labels in the right node group should be specified by \rightnode in this environment.

An edge between a left node and a right node can be drawn by \match command.

If you write

\begin{bipartite}{2cm}{1.5cm}{2cm}{3mm}{2mm}
\leftnode{xxx}
\leftnode{yyy}
\leftnode{zzz}
\rightnode{aaa}
\rightnode{bbb}
\rightnode{ccc}
\match{xxx}{ccc}
\end{bipartite}
you get
\begin{bipartite}{2cm}{1.5cm}{2cm}{3mm}{2mm}
\leftnode{xxx}
\leftnode{yyy}
\left...
...\rightnode{aaa}
\rightnode{bbb}
\rightnode{ccc}
\match{xxx}{ccc}
\end{bipartite}
.

Even if labels are long, you don't have to type them many times as arguments of \match. You can give short names for \leftnode and \rightnode as options, and you can use them as arguments of \match.

If you write

\begin{bipartite}{2cm}{1.5cm}{2cm}{3mm}{2mm}
\leftnode[x]{xxx is very long}
\leftnode{yyy}
\leftnode{zzz}
\rightnode{aaa}
\rightnode[b]{bbb is very long}
\rightnode{ccc}
\match{x}{ccc}
\match{yyy}{b}
\end{bipartite}
you get
\begin{bipartite}{2cm}{1.5cm}{2cm}{3mm}{2mm}
\leftnode[x]{xxx is very long}
\le...
...{bbb is very long}
\rightnode{ccc}
\match{x}{ccc}
\match{yyy}{b}
\end{bipartite}
.